//
//  HResponse.h
//  Request
//
//  Created by 侯伟 on 2019/4/19.
//  Copyright © 2019年 侯伟. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "APIError.h"

NS_ASSUME_NONNULL_BEGIN

@interface HResponse:NSObject

/// 状态码
@property(nonatomic,assign) NSInteger code;

/// 错误信息
@property(nonatomic,copy) NSString* _Nullable msg;

///模型数据
@property(nonatomic,strong)id _Nullable data;

///请求是否成功
@property(nonatomic,assign)BOOL isOK;

///json数据
@property(nonatomic,strong)id _Nullable jsondata;

///json字符串
@property(nonatomic,strong)NSString* _Nullable jsonString;

///错误信息
@property(nonatomic,strong)APIError * _Nullable  error;


///成功
- (HResponse*)success:(void (^)(id data))success;

///失败
- (HResponse*)failure:(void (^)(APIError* error))failure;

///默认失败提示
- (HResponse*)failureDefalut;


@end

NS_ASSUME_NONNULL_END
